using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableOrderType
	{
		public const string Table = "OrderType";
		public const string OrderTypeID = "OrderTypeID";
		public const string OrderTypeName = "OrderTypeName";
	}
	
	[Serializable]
	public class BaseOrderType
		: IDbSessionEntity, IJsonClass
	{
		int m_OrderTypeID;
		/// <summary>
        /// 订单类型表ID
        /// </summary>
        public int OrderTypeID
        {
            get { return m_OrderTypeID; }
            set { m_OrderTypeID = value; }
        }
		
		string m_OrderTypeName;
		/// <summary>
        /// 订单类型名称(门票,酒店.等等)
        /// </summary>
        public string OrderTypeName
        {
            get { return m_OrderTypeName; }
            set { m_OrderTypeName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_OrderTypeID = reader[TableOrderType.OrderTypeID];
            m_OrderTypeName = reader[TableOrderType.OrderTypeName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableOrderType.OrderTypeID, PrimaryKeyType.Identity, OrderTypeID);
			writer[TableOrderType.OrderTypeName] = OrderTypeName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_OrderTypeID = idd;
        }
		
		public string TableName
        {
            get { return TableOrderType.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_OrderTypeID = hashToRead["OrderTypeID"];
			 
             m_OrderTypeName = hashToRead["OrderTypeName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["OrderTypeID"] = OrderTypeID;
			 
            hashToFill["OrderTypeName"] = OrderTypeName;
			 
        }

        #endregion
		
	}
}
